//
//  UIImage+Extention.swift
//  test
//
//  Created by admin on 2016/11/30.
//  Copyright © 2016年 Zhongshan Camry Electronic Company Limited. All rights reserved.
//

import Foundation
import UIKit
extension UIImage{
    class func creatImage(color:UIColor,size:CGSize) -> UIImage {
        let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
        UIGraphicsBeginImageContext(rect.size)
        let context = UIGraphicsGetCurrentContext()
        context?.setFillColor(color.cgColor)
        context?.fill(rect)
        let image = UIGraphicsGetImageFromCurrentImageContext()
        context?.addEllipse(in: rect)
        UIGraphicsEndImageContext()
        return image!
    }
}
